package com.potato.timetable.db.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.potato.timetable.db.obj.ClassDO;

import java.util.List;


@Dao
public interface ClassDAO {

    @Insert
    void insert(ClassDO classDO);

    @Query("SELECT * FROM class WHERE cid = :cid")
    ClassDO selectById(int cid);

    @Query("SELECT * FROM class WHERE cid = :name")
    ClassDO selectByName(String name);

    @Query("SELECT * FROM class")
    List<ClassDO> getAll();

    @Update
    void update(ClassDO classDO);

    @Delete
    void delete(ClassDO classDO);
}
